<?php
namespace App\Module\Teacher\Controller;

use App\Common\Controller\AbstractController;
use App\Module\Teacher\Request\Foot\CreateRequest;
use App\Module\Teacher\Service\FootService;
use Hyperf\Di\Annotation\Inject;

class FootController extends AbstractController{

    /**
     * @Inject()
     * @var FootService $footService
     */
    private $footService;

    public function search(){
        $is_teacher = $this->request->input("is_teacher",false);
        $child_id = $this->request->input("child_id");
        $start_time = $this->request->input("start_time");
        $end_time = $this->request->input("end_time");
        $pagesize = $this->request->input("pagesize");

        return $this->response->json($this->footService->search($is_teacher,$child_id,$start_time,$end_time,$pagesize));
    }

    public function add(CreateRequest $request){
        return $this->response->json($this->footService->create($request));
    }

    public function delete(int $id){
        return $this->response->json($this->footService->delete($id));
    }
}